<?php
include("../connection/connection.php");
include("reportFunctions.php");
$distId=$_REQUEST['distId'];
$sqlReport = "SELECT distinct `district_id`,`district_name`,`block_id`,`block_name` FROM `tbl_lookup_location` where `district_id` = ".$distId." group by `block_id`";
$queryReport = mysql_query($sqlReport);
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Report</title>
</head>
<body>
<table border="0" width="754" cellspacing="0" cellpadding="0">
	<tr>
		<td width="754" height="26" bgcolor="#E9E9E9">
		<p align="center"><span style="font-size: 9pt; font-weight: 700">
	  <font face="Verdana" color="#224568">Block wise average minimum and maximum water table fluctuation</font></span></td>
	</tr>
	
	<tr>
		<td bgcolor="#E9E9E9" height="56">
		<table border="1" width="753" cellspacing="0" cellpadding="0" height="47" bgcolor="#C5D8EB">
			<tr>
				<!--<td width="151" align="center" rowspan="2">
				<font style="font-size: 8.5pt" face="Verdana">District</font></td>-->
				<td width="190" align="center" rowspan="2">
				<font style="font-size: 8.5pt" face="Verdana"><b>Block</b></font></td>
				<td width="157" align="center" rowspan="2">
				<p align="center"><font face="Verdana" style="font-size: 8.5pt">
			  <b>Functional (No.)</b></font></td>
				<td align="center" colspan="2">
				<font style="font-size: 8.5pt" face="Verdana"><b>Water table fluctuation (m)</b></font></td>
								
			</tr>
		
			<tr>
				
				<td align="center" width="144"><font style="font-size: 8.5pt" face="Verdana"><b>Min</b></font></td>
				<td align="center" width="252"><font style="font-size: 8.5pt" face="Verdana"><b>Max</b></font></td>
				
		</tr>
		<?php
			//$numVillage=0;
			//$numFormVill=0;
			while($rowReport = mysql_fetch_array($queryReport)) {
		?>
			<tr bgcolor="#FFFFFF">
				<!--<td width="151" align="center"><font style="font-size: 8.5pt" face="Verdana"><?php //echo $rowReport['district_name'];?></font></td>-->
				<td width="190" align="center"><font style="font-size: 8.5pt" face="Verdana"><?php echo $rowReport['block_name'];?></font></td>
				<td align="center" width="157"><font style="font-size: 8.5pt" face="Verdana"><?php echo getTotalNotfunctional($rowReport['block_id'],'FUNCTIONAL');?></font></td>
				<td align="center" width="144"><font style="font-size: 8.5pt" face="Verdana"><?php echo getRangeWater($rowReport['block_id'],'water_table_min');?></font></td>
				<td align="center" width="252"><font style="font-size: 8.5pt" face="Verdana"><?php echo getRangeWater($rowReport['block_id'],'water_table_max');?></font></td>
				
				
				
				
				
			</tr>
			<?php
			}
			?>
			<tr bgcolor="#E9E9E9">
				<td width="190" align="center"><font style="font-size: 8.5pt" face="Verdana"><b>Total</b></font></td>
				<td align="center" width="157"><font style="font-size: 8.5pt" face="Verdana"><b><?php echo getSumfunctionalStatus($distId,'FUNCTIONAL');?></b></font></td>
				<td align="center" width="144"><font style="font-size: 8.5pt" face="Verdana">&nbsp;</font></td>
				<td align="center" width="252"><font style="font-size: 8.5pt" face="Verdana">&nbsp;</font></td>
				
				
			</tr>

			
		</table>
		</td>
	</tr>
</table>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>



</body>

</html>

